package com.liuyucheng.idea_springboot.rabbitmq;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

//@Component
public class RabbitMqListener {

    @RabbitListener(queues = RabbitMqConfig.QUEUE_NAME)
    public void listenerQueue(Message message){
        byte[] body = message.getBody();
        String content = new String(body);
        System.out.println(content);
    }
}
